package com.design.classroommanagement.util;

import java.sql.PreparedStatement;

public class UserAdmin extends DBUtils{
    public boolean select( String id, String password) throws Exception {
        PreparedStatement prepare = null;
        admin item=null;
        try {
            conn = DBUtils.getConnect();
            String sql = "select * from admin where Ano=?and Password=?";
            prepare = conn.prepareStatement(sql);
            prepare.setString(1, id);
            prepare.setString(2, password);
            rs = prepare.executeQuery();
            if (rs.next()) {
                item = new admin();
                item.setAno(id);
                item.setPassword(password);
                return true;
            }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        }
        return false;
    }
}
